home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / dtp / hwgpost / init.ps < prev    next >
Encoding:
Text File  |  1996-07-16  |  3.8 KB  |  155 lines

  1. %!
  2. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  3. % HWGPOST >= V22.25 initialisation file
  4. %
  5. % $Id: init.ps,v 2.19 1996/05/29 17:42:21 heinz Exp $
  6. %
  7. % HWGPOST ©1993-1996 Heinz Wrobel, for Joan Thuesen
  8. %
  9. % Based loosely on Post V1.7 (C) Adrian Aylward 1989, 1991
  10. %
  11. % You may freely copy, use, and modify this file
  12. %
  13. % This file should be run before most programs
  14. % Developers: Do NOT run this file with job server flags like PSFLAGSAVE!
  15. %
  16. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  17.  
  18. % A dummy status dictionary with some common values needed
  19. % for dumb applications
  20. false setglobal
  21. statusdict begin
  22. /waittimeout 0 def
  23. /setdefaulttimeouts {pop pop pop} bind def
  24. /setjobtimeout { pop } bind def
  25. /jobtimeout 0 def
  26. /a4tray {} def
  27. end
  28.  
  29. % We need global VM for modifications to systemdict!
  30. currentglobal true setglobal
  31. systemdict begin
  32.  
  33. % Ignore CTRL/D, CTRL/L, and simple CRs
  34.  
  35. <04> cvn {} def
  36. <0c> cvn {} def
  37. <0d> cvn {} def
  38.  
  39. % Dummies for ugly PostScript code
  40.  
  41. /letter {} def
  42. /note {} def
  43. /legal {} def
  44. /a5 {} def
  45. /a4 {} def
  46. /a3 {} def
  47.  
  48. % Some fonts are unfortunately very bad!
  49. /@@findfont /findfont load def
  50. /findfont
  51. {
  52.     currentpacking false setpacking exch @@findfont exch setpacking
  53. } bind def
  54.  
  55. % If you have any problems with sudden range checking errors for
  56. % graphics commands, you might want to try to uncomment this line
  57. % to circumvent problems with PS files that really shave it too close.
  58. % /setbbox {pop pop pop pop} bind def
  59.  
  60. % Ok, lets return to the previous vm mode and make the systemdict readonly
  61. end
  62. systemdict readonly pop
  63. setglobal
  64.  
  65. %
  66. % We try to register all our resources on disk now. This speeds up
  67. % access and makes them easily available to the resource operators.
  68. %
  69. % We look for the file "HWGPOSTResources" and execute it if it is available
  70. % If not, we check for it as "POST:HWGPOSTResources", too.
  71. % If this fails again, we can't do anything reasonable about it, so we don't.
  72. %
  73. (HWGPOSTResources) dup status
  74. {
  75.     pop pop pop pop true
  76. }
  77. {
  78.     pop
  79.     (%POST%HWGPOSTResources) dup status
  80.     {
  81.         pop pop pop pop true
  82.     }
  83.     {
  84.         pop false
  85.     }
  86.     ifelse
  87. }
  88. ifelse
  89. {
  90.     currentglobal exch true setglobal
  91.     run
  92.     setglobal
  93. }
  94. if
  95.  
  96. %
  97. % To keep compatibility with the old post.library I need to have
  98. % the renderband commands available. I don't want them to "clutter"
  99. % the PS name space by default, so they are built in as "@currentband"
  100. % and "@setband" and need to be redefined for "old" SW.
  101. %
  102. % I encourage any user of HWGPOST to use the "@" names for these operators
  103. % as I might drop support for the old names in init.ps in the future.
  104. %
  105. /currentband /@currentband load def
  106. /setband /@setband load def
  107.  
  108. %
  109. % Even more ugly compatibility magic. Most people won't need this. Those who
  110. % do should refer to HWGPOSTlib.doc and hopefully find a way to avoid it.
  111. %
  112. systemdict /@callextfunc known {/callextfunc /@callextfunc load def} if
  113.  
  114. %
  115. % Due to many requests the default font handling of stone age post is
  116. % back in disguise. If you don't want it, just throw out the definitions
  117. % below.
  118.  
  119. % Our DefaultFont prints out big dots ...
  120. %
  121. /@DefaultFont
  122. <<
  123. /FontName /@DefaultFont
  124. /FontMatrix [0.001 0 0 0.001 0 0]
  125. /FontType 3
  126. /FontBBox [0 -300 500 700]
  127. /Encoding StandardEncoding
  128. /BuildChar
  129. { pop pop
  130.   500 0 50 0 450 400 setcachedevice
  131.   250 200 200 0 360 arc closepath fill
  132. } bind
  133. /Painttype 0
  134. >>
  135. definefont pop
  136.  
  137. %
  138. % Heavy magic to make the font lookup mechanism respect your choice of
  139. % a default font. If you want another font, you simply specify the name
  140. % of the font.
  141. %
  142. % An established default font is /Courier. You can obviously use it only
  143. % if you have that font.
  144. %
  145. /@DefaultFontName /@DefaultFont def
  146. %/@DefaultFontName /Courier def
  147.  
  148. %
  149. % Get rid of the considerable amount of garbage after setup by forcing
  150. % a garbage collection.
  151. %
  152. 2 vmreclaim
  153.  
  154. %%% EOT %%%
  155.